<template>
  <div>
    <ZgDialog
      :width="view.width"
      :top="view.top"
      :title="view.title"
      v-model="visible"
      @ok="save">
      <a-descriptions title="推送日志">
        <a-descriptions-item label="取货单号">1000000000</a-descriptions-item>
        <a-descriptions-item label="状态">已取货</a-descriptions-item>
        <a-descriptions-item label="销售单号">1234123421</a-descriptions-item>
        <a-descriptions-item label="子订单">3214321432</a-descriptions-item>
      </a-descriptions>
    </ZgDialog>
  </div>
</template>
<script>
export default {
  props: {
    view: {
      type: Object,
      default: () => {
        return { width: '60%', top: '5%', title: '日志' }
      }
    }
  },
  data () {
    return {
      layout: {
        视图边距: 10, 标签宽度: 120, 标签对齐: 'right', 左右间距: 10, 上下间距: 10
      },
      columns: [
        { code: 'taskName', compType: '单行文本', name: '任务名称', isNeed: true, offset: 0, span: 12, defaultVal: '', regex: '', errorMsg: '任务名称是必填啊' },
        { name: '目标系统', code: 'targetSystem', compType: '下拉选择', isNeed: true, offset: 0, span: 12, defaultVal: '1', extra: { 下拉选项: [{ value: '1', label: '虚拟仓' }, { value: '2', label: '交易' }] } },
        { code: 'taskName', compType: '单行文本', name: '目标接口', isNeed: true, offset: 0, span: 12, defaultVal: '', regex: '', errorMsg: '' },
        { code: 'taskName', compType: '单行文本', name: '目标参数', isNeed: true, offset: 0, span: 12, defaultVal: '', regex: '', errorMsg: '' },
        { code: 'taskName', compType: '单行文本', name: '目标数据库', isNeed: true, offset: 0, span: 12, defaultVal: '', regex: '', errorMsg: '' },
        { code: 'taskName', compType: '单行文本', name: '目标表', isNeed: true, offset: 0, span: 12, defaultVal: '', regex: '', errorMsg: '' },
        { code: 'taskName', compType: '单行文本', name: '数据选择逻辑', isNeed: true, offset: 0, span: 12, defaultVal: '', regex: '', errorMsg: '' },
        { code: 'taskName', compType: '单行文本', name: '数据转换逻辑', isNeed: true, offset: 0, span: 12, defaultVal: '', regex: '', errorMsg: '' },
        { code: 'taskName', compType: '单行文本', name: '数据映射逻辑', isNeed: true, offset: 0, span: 12, defaultVal: '', regex: '', errorMsg: '' },
        { code: 'taskName', compType: '单行文本', name: '推送方式', isNeed: true, offset: 0, span: 12, defaultVal: '', regex: '', errorMsg: '' },
        { name: '生效时间', code: 'last_login_time', compType: '日期时间', isNeed: true, offset: 0, span: 12, defaultVal: '' }
      ],
      formulas: [],
      visible: false
    }
  },
  watch: {
    viewId () {
      this.fetchView()
    }
  },
  mounted () {
    this.fetchView()
  },
  methods: {
    open () {
      this.visible = true
    },
    fetchView () {
      // if (!this.viewId || this.viewId.length === 0) {
      //   return
      // }
      // this.$http.get('/zg-autoform/view/findById', { id: this.viewId }, res => {})
    },
    save () {
      console.log('onOk', '这是indiv下pushTask 路径下名为 Add.vue的文件中的第 81 行🤺🤺🤺')
      this.visible = false
    }
  }
}
</script>

<style lang="scss" scoped>
</style>
